package com.kaiwukj.android.ufamily.mvp.http.entity.event;

import androidx.annotation.IntDef;

/**
 * Created by lidacheng on 2018/6/14.
 */

public class PayEvent {

    public static final int SUCCESS = 1;
    public static final int CANCEL = 2;
    public static final int FAILED = 3;

    @IntDef({SUCCESS, CANCEL, FAILED})
    public @interface ResultCode {
    }

    private int code;
    private int buytype;
    private String desc;

    public PayEvent(@ResultCode int code, int buytype, String desc) {
        this.code = code;
        this.buytype = buytype;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public void setCode(@ResultCode int code) {
        this.code = code;
    }

    public boolean isSuccess() {
        return code == 1;
    }

    public int getBuytype() {
        return buytype;
    }

    public void setBuytype(int buytype) {
        this.buytype = buytype;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
